import java.util.Scanner;

public class Maxnumber {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入两个数:");
        int num1=scanner.nextInt();
        int num2=scanner.nextInt();

        int t=0;
        if(num1>num2){
           t = num2;
        }else{
            t = num1;
        }
        while(num1 % t == 0 && num2 % t==0){
            System.out.println("最大公约数:"+t);
            break;
        }
        t--;
    }
}
